|
![](/i/fill.gif) |
Patrick Elliott wrote:
> Actually, that *won't* work as I intended.
Well, adjust as needed.
> In most cases you are going
> to be dealing with something that only have *one* side to it, like a
> HUD. In other cases, you may be dealing with something that has a
> complex surface, but you don't want/need to know which "triangle" was
> touched, you need to know where on the "texture" was touched, which
> "may" overlap several such triangles, if its a complex shape.
Sure. But the client knows why it drew the pixel you clicked on in red,
or blue, or orange. So the client is already doing all the math to
figure out exactly which texture is drawn where on each pixel. That's my
point.
After that, the server only needs to know if the client's request is
*possible* to make sure it's legal.
> client/server determines that you "would have" also touched that face,
Well, is it the client, or the server, that figures that out? I thought
that's what you were asking.
> It won't work with *hugely* complex surfaces, but for
> anything that uses a relatively flat surface anyway, the result will,
> even if you map over something not 100% flat, be "close" to what you
> figured when designing the texture. And of course, if you had such a
> system, you could add a feature to any "editors" that may be designed
> later to produce an "accurate" location, even if it is on a complex
> surface.
But you don't have to do that. The client is already doing all the
"accurate location" math when it draws the object on the screen, even
for a HUD.
In other words, start out not thinking of it as "where on the object did
I touch", but instead think of it as "where on the screen did I touch"
followed by "what did I draw on the screen at that location".
> You method would require something a lot more complicated, involving
> determining if the right texture is on that part of the object, if it
> is, where that is in relationship "to" that texture, and a mess of other
> things that are, frankly, not likely to be in the library anyway, since
> textures are just mapped via GPU to the surfaces, and there probably are
> not any functions, either in the GPU, or in the library used to place
> them there, that can return that kind of information,
That seems like a pretty sucky library. :-) Obviously the math is easy
enough to do in a small fraction of a second, tho. In any case,
anything you can offload to the client is something you *should* offload
to the client, in that architecture. Once the client has figured out
what you touched where, chances are the server can confirm it more
easily than it can iterate through all the possible textures and prims
within visual distance of your camera. Especially if you're close to the
edge of a server.
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
![](/i/fill.gif) |